// Header file for linked list resources

#ifndef LIST_H
#define LIST_H

#include <omp.h>

class NeighborListEntry;
class ShingleListEntry;
class Shingle;

class NeighborList
{
	public:
		void Push(unsigned long item);
		void Push_NoThread(unsigned long item);
		NeighborListEntry* StartIterator();
		unsigned long Head();
		unsigned long Tail();
		unsigned int Size();

		NeighborList();
		~NeighborList();

		void ClearData();

		NeighborListEntry *tail;
		NeighborListEntry *head;
		unsigned int size;
	private:
//		omp_lock_t lock;
//
//		void Lock();
//		void Unlock();
};

class NeighborListEntry
{
	public:
		unsigned long value;
		NeighborListEntry *next;
		static NeighborListEntry *AllocateNeighborListEntry(unsigned long item);
		static void SetupAllocs();

		NeighborListEntry();

	private:
		NeighborListEntry(unsigned long item);
};

class ShingleList
{
	public:
		void Push(Shingle *item);
		Shingle *Pop();
		ShingleListEntry* StartIterator();
		Shingle* Head();
		Shingle* Tail();
		unsigned int Size();

		ShingleList();
		~ShingleList();

	private:
		ShingleListEntry *head;
		ShingleListEntry *tail;
		unsigned int size;
};

class ShingleListEntry
{
	public:
		Shingle *value;
		ShingleListEntry *prev;
		ShingleListEntry *next;

		ShingleListEntry(Shingle *item);
};

#endif
